package com.mpdbailey.cleverdicandroid;

import java.io.IOException;
import java.io.InputStream;
import java.util.List;

import android.app.Application;

public class CleverDicApplication extends Application
{
	private List<String> _Dictionary;
	/*
	 * Dicitionary is stored in the application since activities are created and destroyed
	 * on rotations.
	 * 
	 */
	public List<String> GetDicitionary()
	{
		return _Dictionary;
	}
		
	void LoadDictionary() throws IOException
	{
		InputStream inputStream = null;
		try
		{
			inputStream = getResources().openRawResource(R.raw.wordlist);
			_Dictionary = DictionaryReader.LoadDictionary(inputStream);
		} 
		finally
		{
			if (inputStream != null)
			{
				inputStream.close();
			}
		}
	}
	
}
